<?php
    @header("Content-type:text/html;charset=utf-8");
    @include_once("./connect.php");

    if(!(isset($_GET["id"]))){
        $obj = array();
        $obj["status"] = false;
        $obj["msg"] = "请传入参数";
        $json = json_encode($obj);
        exit($json);
    }

    $id = $_GET["id"];

    $sql = "SELECT * FROM `goodslist` where goodsId = '$id'";

    $result = mysqli_query($conn,$sql);

    $obj = array();
    if($result){
        $item = mysqli_fetch_assoc($result);
        $obj["status"] = true;
        $obj["msg"] = "成功";
        $obj["list"] = $item;
    }else{
        $obj["status"] = false;
        $obj["msg"] = "sql语句有误";
        $obj["sql"] = $sql;
    }
    echo json_encode($obj);

?>